['framework/stat.pl'].
['framework/base.pl'].
['framework/derive.pl'].
['framework/ca.pl'].


current_prolog_flag(argv,L),nth1(2,L,FILE), [FILE].
current_prolog_flag(argv,L),nth1(3,L,ACTOR), assert(act(ACTOR)).

act(A), findall(M,knows(A,M),LSTA), list_to_set(LSTA,SETA), 
length(SETA,L), print('#msgs '), print(L), print('\n'), 
complexity(SETA,CA), print('#items '), print(CA), print('\n').

act(A), findall(T,(knows(A,Y),contains(Y,pri(T,LST))),LSTTL),
list_to_set(LSTTL,SETTL), length(SETTL,L), print('#prims '), print(L), print('\n'),
findall(N,(member(T,SETTL),nrules(T,N)),ALLN), list_sum(ALLN,ALLNS), print('#rules '), print(ALLNS), print('\n').
%forall(member(T,SETTL),(print(T),print(' '))).

print('derivation: '), act(A), time(derall(A,LSTD)), forall(member(M,LSTD),assert(der(A,M))).

print('view: '), act(A),
time((findall(X,(X=ctxm(_,P,_,_,_),derca(A,X),P\=dot),_),pcontexts(A,C),linkablepart(A,C,CP))).